#!/bin/bash

total_bytes=""
tx_bytes=$(adb shell cat /sys/devices/virtual/net/rmnet0/statistics/tx_bytes)
rx_bytes=$(adb shell cat /sys/devices/virtual/net/rmnet0/statistics/rx_bytes)

len=$(expr `expr length $tx_bytes` - 1)
tx=$(expr substr $tx_bytes 1 $len)

len=$(expr `expr length $rx_bytes` - 1)
rx=$(expr substr $rx_bytes 1 $len)

total_bytes=$(expr $rx + $tx)
echo "tx: $tx, rx: $rx, total: $total_bytes"
